<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>设计师个人中心</title>
    <link type="text/css" rel="stylesheet" href="../Public/css/reset.css">
    <link type="text/css" rel="stylesheet" href="../Public/css/DateTimePicker.css">
    <link type="text/css" rel="stylesheet" href="../Public/css/style.css">
    <script type="text/javascript" src="../Public/script/jquery.js"></script>
<script type="text/javascript" src="../Public/layer/layer.js"></script>

    <script type="text/javascript">

function modifyPassword(){
    var oldpassword=$("#password").val();
    var newpassword=$("#newpassword").val();
    var renewpassword=$("#renewpassword").val();
    if(oldpassword==""){
        layer.alert("请输入原密码");
        return false;
    }else if(newpassword==""){
        layer.alert("请输入新密码");
        return false;
    }else if(renewpassword==""){
        layer.alert("请确认新密码");
        return false;
    }else if (renewpassword!=newpassword){
        layer.alert("两次输入密码不同");
        return false;
    }else if (oldpassword==newpassword){
        layer.alert("新旧密码相同");
        return false;
    }else{
        $.ajax({
            url:'index.php?m=home&c=User&a=modifyPassword',
            data:{
               'newpassword':newpassword,
                 'oldpassword':oldpassword
            },
            type:'post',
            success:function(data){
                    if(data==0){
                  layer.alert("修改失败，请重新修改");
                        return false;
                  }else if (data==1) {
                      layer.alert("原密码输入错误");
                        return false;
                  }else if(data==2){
                    layer.alert("密码修改成功",function(){
                         location.href="{:U('User/mima')}";


                    });
                        
                    }
            }

        });
    }
}


    </script>
    <style>
        input{
            border: 1px solid #D3D4D3;
        }    
        .tr{
            width: 100%;
            display:block;
            margin: 1%;
        }
        .td{
            width: 50%;
            text-align: right;
            padding-right: 5%;
        }
        .title-img{
            background: url("../Public/images/center.jpg") center no-repeat;
            height: 160px;
            background-size: cover; -moz-background-size: cover;
        }
        .big{
            display: flex;flex-direction: row;padding-right: 2%;padding-left: 2%;margin-bottom: 2%;margin-top:15px;
        }
        .active{
            color: red;
        }
        .center_ul{
            width: 100%;margin: 0;padding: 0;
        }
        .center_li{
           font-weight: 400;padding: 10px;
        }
        .menu{
            width:15%;background-color: #e6f1ef;text-align: center;margin: 0;padding: 0;height: 500px
        }
        .top01{
            width: 80%;margin-left: 10px;
        }
        .top01 .menu-top{
            display: flex;
            flex-direction:row;
            width: 100%;
            justify-content:space-between;
            margin: 0;
            padding-bottom: 1.5%;
            padding-top: 1.5%;
            color: #353333;
            text-align: center;
            background-color: #7bc2f1;
        }
        .top01 .menu-msg{
            font-size: 14px;
            display: flex;
            flex-direction:row;
            width: 100%;
            justify-content:space-between;
            margin: 0;padding: 0;
            text-align: center;
            background-color: #b1bbb9;
        }
        .top01 .menu-msg li {
            padding: 1%;width: 9%;align-self: center;
        }
        .top01 .menu-top li{
            padding: 1%;width: 9%;
        }
        .top01 .menu_top{
            margin-bottom: 1%;
        }
        .bottom_01{
            display: flex;flex-direction:row;width: 100%;justify-content:space-between;margin: 0;padding: 0;text-align: center;
        }
        .bottom_01 .table{
            padding: 1%;width: 9%;align-self: center;
        }
        .bottom_01 .img{
            display: flex;flex-direction:column; width: 10%;
        }
        .bder{
            border: 1px solid #2e8ded;margin-bottom: 2%;
        }
        .pdg{
            padding: 1%;border-bottom: 1px solid #e6f1ef;
        }
            .txt_line{
        margin: 20px;
        width: 200px;
    }
    .txt_lineTwo{
        float: left;
        margin: 15px;

    }
    .text_lineTable{
        margin-left: 20px;
    }
    </style>
</head>
<body>
<!-- 公共头部引用 str -->
<include file="Common:header"/>
<!-- 公共头部引用 str -->
<div class="title-img"></div>
<div class="big" ><!--style="display: block"-->
        <div class="menu">
            <include file="Common:menu"/>
        </div>
        <div class="top01" style="display: block">
           
            <div id="7" style="display: ;">
                <div style="float: left;margin-left: 5px;border: solid 1px #cccccc; padding-left: 20px;width: 60%">
                    <div style="text-align: right;float: left;">

                        <div style="margin-top: 30px">当前登录密码：</div>
                        <div style="margin-top: 45px">新的登录密码：</div>
                        <div style="margin-top: 45px">确认新的登录密码：</div>
                    </div>
                    <div style="float: left;margin-bottom: 20px">

                        <div>
                            <input style="width:380px;margin-top: 23px; height: 32px" type="password" id="password" name="oldpassword" placeholder="当前登录密码">
                        </div>
                        <div>
                            <input style="margin-top: 23px;width:380px; height: 32px" type="password" id="newpassword" name="newpassword" placeholder="新的登录密码">
                        </div>
                        <div>
                            <input style="margin-top: 23px;width:380px;height: 32px"  type="password" id="renewpassword" name="renewpassword" placeholder="确认新的登录密码">
                        </div>
                    </div>
                          <div style="clear: both;text-align: center; " ><button style="padding: 10px 40px;background-color:#49bf9d;border: none;margin-top: 20px" onclick="modifyPassword()" >确定</button></div>

                </div>
          
            </div>

        </div>

</div>
 


<!--bottom-->
<include file="Common:footer"/>
<!--bottom end-->
<script type="text/javascript" src="../Public/script/jquery.js"></script>
<script>
    $(function(){
        $(".menu-top li").click(function(){
            var ss=$(this)
            $(".menu-top li").removeClass("active")
            ss.addClass("active")
        })
        $(".center_ul li").click(function(){
            var ss=$(this)
            $(".center_ul li").removeClass("active")
            ss.addClass("active")
        })
    })
</script>
</body>
</html>